package ControlLayer;

import ModelLayer.*;
import java.util.ArrayList;
/**
 * Write a description of class LoanCtr here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class LoanCtr
{
    private DVDCtr dvdCtr;
    private AddressCtr addrCtr;
    private LoanContainer loanCont;

    public LoanCtr()
    {
        dvdCtr = new DVDCtr();
        addrCtr = new AddressCtr();
        loanCont = LoanContainer.getSingleton();
    }
    
    public void createLoan(int dvdId, int loanerId, int specimenId, int loanId)
    {
        Specimen specimen;
        specimen = dvdCtr.getSpecimen(dvdId, specimenId);
        Person loaner;
        loaner = addrCtr.getPerson(loanerId);
        
        loanCont.createLoan(loaner, specimen, loanId);
    }
    
    public void returnLoan(int loanId)
    {
        loanCont.returnLoan(loanId);
    }
}